package com.gao.format;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Scanner;

/**
 * @Author: ShanYuqing
 * @Version: v1.0
 */
public class test {
    /*
        计算你来这个世界多少天了
     */
    public static void main(String[] args) throws ParseException {
        Scanner sc =new Scanner(System.in);
        System.out.println("请输入您的生日：xxxx年xx月xx日");
        String birthday = sc.nextLine();
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy年MM月dd日");
        Date parse = dateFormat.parse(birthday);
         long time1 = parse.getTime();
         Date date = new Date();
         long time = date.getTime()-time1;
         long day = time/1000/60/60/24;
        System.out.println("已经"+day+"天了");

    }
}
